﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectSem3.Admin
{
    public partial class TemplateAdmin : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                AdminLogin ad = (AdminLogin) Session["admin"];
                if (ad == null)
                {
                    Response.Redirect("login.aspx");
                }
                else
                {
                    if (ad.pemision.Equals(1))
                    {
                        account.Visible = true;
                    }
                    else
                    {
                        account.Visible = false;
                    }
                    this.LabelUsername.Text = ad.username;
                }
            }
        }
    }
}